package com.wolfalpha.lwtool.constant;

import android.content.Context;

import com.wolfalpha.lwtool.db.DBDao;
import com.wolfalpha.lwtool.net.Client;
import com.wolfalpha.lwtool.service.BaseService;
import com.wolfalpha.lwtool.service.impl.BaseServiceImpl;

/**
 * 全局设置
 * 
 * @author ttStudio
 * 
 */
public class Application {
	
	// 活动代号
	public static String N_MAIN = "Main_";
	public static String N_DYNAMIC = "Dynamic_";
	public static String N_SETTING = "Setting_";
	public static String N_LOGIN = "Login_";
	public static  String N_HISTORY = "History_";
	public static  String N_INFO = "Info_";

	public static String N_FRONT = "";

	public static void setFrontActivity(String str) {
		N_FRONT = str;
	}

	public static Client client = null;

	public static Client getClient() {
		if (client == null) {
			client = new Client();
		}
		return client;
	}

	public static DBDao dbdao = null;

	public static DBDao getDao(Context c) {
		if (c == null) {
			return null;
		}
		if (dbdao == null) {
			dbdao = new DBDao(c);
		}
		return dbdao;
	}

	public static BaseService baseSrv = null;

	public static BaseService getBaseService(Context context) {
		if (baseSrv == null) {
			baseSrv = new BaseServiceImpl(context);
		}
		return baseSrv;
	}

	public static boolean serviceStarted = false;
}
